package org.example.mqtt;

import org.springframework.integration.annotation.MessageEndpoint;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.Message;

@MessageEndpoint
public class MqttListener {

    @ServiceActivator(inputChannel = "messageChannel")
    public void handleMessage(Message<?> message) {
        System.out.println("Received message: " + message.getPayload());
    }
}
